package com.work.vo.transport;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.Func;

/**
 * 客户代码VO
 *
 * @author ：dujianyu
 * @since ：Created in 2024/7/8 14:23
 */
@Data
public class ClientCodeVO {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "代码")
    private String clientCode;

    @ApiModelProperty(value = "名称")
    private String clientName;

    @ApiModelProperty(value = "拼音")
    private String pinyinShort;

    @ApiModelProperty(value = "名称带拼音")
    private String nameWithPinyin;

    public String getNameWithPinyin() {
        if (Func.isNull(clientName)) {
            return "";
        }
        return clientName + "(" + pinyinShort + ")";
    }
}
